package config

import (
	"fmt"
	"github.com/spf13/viper"
)

type Appconfig struct {
	NaCos struct {
		IpAddr string
		DataId string
		Group  string
	}
}

var ViperConfig Appconfig

func GetViperConfig() {
	viper.SetConfigFile("./config/dev.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		return
	}
	fmt.Println("文件读取成功")
	err = viper.Unmarshal(&ViperConfig)
	if err != nil {
		return
	}
	fmt.Println("文件解析成功")
}
